package com.mutual.system.areaInfo.pojo;

import java.util.Date;

import com.mutual.commom.pojo.PojoObject;

import lombok.Data;

@Data
public class AreaInfo extends PojoObject{
	
    private Integer id;

    private String name;

    private String code;

    private String parentCode;

    private Integer pId;

    /**
     * 1：省 2：市 3：区县
     */
    private Integer grade;

    private Date createDate;

    private Date updateDate;
    /**
     * 1:可用 2：不可用
     */
    private Integer state;
    
    private String iconSkin;
    
    private boolean isParent=true;
    

    public enum AreaInfoGradeEnum {
    	
    	GRADE_PROVICE(1,"省"),GRADE_CITY(2,"市"),GRADE_SUB_CITY(3,"区县");
    	
    	private int value;
    	
    	private String name;
    	
    	private AreaInfoGradeEnum (int value,String name){
    		this.value=value;
    		this.name=name;
    	}

    	public static AreaInfoGradeEnum getAreaInfoEnumByValue(int value){
    		for(AreaInfoGradeEnum a:values()){
    			if(a.getValue()==value){
    				return a;
    			}
    		}
    		return null;
    	}
    	
		public int getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
    }
    
    public  enum AreaInfoStateEnum {
    	
    	STATE_YES(1,"可用"),STATE_NO(2,"不可用");
    	
    	private int value;
    	
    	private String name;
    	
    	private AreaInfoStateEnum (int value,String name){
    		this.value=value;
    		this.name=name;
    	}

    	public static AreaInfoStateEnum getAreaInfoEnumByValue(int value){
    		for(AreaInfoStateEnum a:values()){
    			if(a.getValue()==value){
    				return a;
    			}
    		}
    		return null;
    	}
    	
		public int getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
    }

	public Integer getPId() {
		return pId;
	}
	
	
	public boolean getIsParent() {
		return isParent;
	}

	public void setPId(Integer pId) {
		this.pId = pId;
	}
    
}